package com.foreknow.practice.OOp;

import java.util.Scanner;

public class Test11 {
    String answer = "";//  y / n
    Test10 test10 =new Test10();
    public void add(){
            //请输入图书编号
            Scanner input = new Scanner(System.in);
            System.out.println("请输入图书编号");
            int number =input.nextInt();
            //请输入购买数量
            System.out.println("请输入购买数量");
            int quantity =input.nextInt();

            System.out.println("是否继续 y / n");
            answer=input.next();
    }
    public void outbook( Test10[] books) {
        String line = null;
        Test10 p1 = new Test10();
        p1.setNumber(1);
        p1.setQuantity(50);
        p1.setName("Java");
        p1.setMoney(33.45);
        Test10 p2 = new Test10();
        p2.setNumber(2);
        p2.setQuantity(150);
        p2.setName("Jsp");
        p2.setMoney(55.45);
        Test10 p3 = new Test10();
        p3.setNumber(3);
        p3.setQuantity(250);
        p3.setName("Ssm");
        p3.setMoney(77.45);
        books[0] = p1;
        books[1] = p2;
        books[2] = p3;
        for (int i = 0; i < books.length; i++) {
          line = books[i].getName() + "---------" + books[i].getMoney() + "----------" + books[i].getNumber() + "---------" + books[i].getQuantity();
            System.out.println(line);
        }
    }

    public static void main(String[] args) {
        Test11 test11 = new Test11();
        test11.add();
        Test10 test10 =new Test10();

//        switch(test10.getNumber()){
//            case 1:
//                test10.setName("java");
//                test10.setMoney(33.45);
//                test10.setQuantity(test10.getQuantity());
//            case 2:
//                test10.setName("jsp");
//                test10.setMoney(55.45);
//                test10.setQuantity(test10.getQuantity());
//            case 3:
//                test10.setName("ssm ");
//                test10.setMoney(77.45);
//                test10.setQuantity(test10.getQuantity());
//        }

    }

}
